// special thanks to https://github.com/MihailRis!
// code example used:
//   - https://github.com/MihailRis/VoxelEngine-Tutorials-Part-2/blob/master/src/window/Events.cpp

#pragma once

#include <cstdint>

class GLFWwindow;
enum class CursorLockMode;
class C_Cursor;

namespace carbon {
    class C_Events {
        public:
            // methods
            static int initialize();
            static void poll();

            static bool pressed(int keycode);
            static bool justPressed(int keycode);
            static bool released(int keycode);
            static bool justReleased(int keycode);
            static bool clicked(int button);
            static bool justClicked(int button);

            // callbacks
            static void glfwKeyCallback(GLFWwindow* win, int key, int scancode, int action, int mods);
            static void glfwMouseButtonCallback(GLFWwindow* win, int button, int action, int mode);
            static void glfwCursorPosCallback(GLFWwindow* win, double xpos, double ypos);
            static void glfwFramebufferSizeCallback(GLFWwindow* win, int w, int h);

            // variables
            static bool* _keys;
            static uint32_t* _frames;
            static uint32_t _currentFrame;
    };
}